is_finding = false;
general_name = "no_general";
item_name = "no_item";
function FindGeneralsAndItems()
{
	if (is_finding)
	{
		is_finding = false;
		$("#Find").SetHasClass("CantUse", is_finding);
	}
	else
	{
		is_finding = true;
		$("#Find").SetHasClass("CantUse", is_finding);
		GameEvents.SendCustomGameEventToServer("find_generals_and_items", {});
	}
}
function FindShowTooltip()
{
	var Button = $("#FindButton");
	$.DispatchEvent("DOTAShowTitleTextTooltip",Button,"#Find", "#Find_Description");
}
function FindHideTooltip()
{
	$.DispatchEvent("DOTAHideTitleTextTooltip",$("#FindButton"));
}
function EndCooldown(data)
{
	general_name = data.general;
}
function GeneralShowTooltip()
{
	var Button = $("#GeneralButton");
	$.DispatchEvent("DOTAShowTitleTextTooltip",Button,$.Localize("#"+general_name), $.Localize("#"+general_name+"_Description"));
}
function GeneralHideTooltip()
{

	$.DispatchEvent("DOTAHideTitleTextTooltip",$("#GeneralButton"));
}
function PurchaseGeneral()
{

}
function ItemShowTooltip()
{
	var Button = $("#ItemButton");
	$.DispatchEvent("DOTAShowTitleTextTooltip",Button,$.Localize("#"+general_name), $.Localize("#"+general_name+"_Description"));
}
function ItemHideTooltip()
{

	$.DispatchEvent("DOTAHideTitleTextTooltip",$("#ItemButton"));
}
function PurchaseItem()
{

}

(function()
{
	$("#General").SetHasClass("CantUse", true);
	$("#Item").SetHasClass("CantUse", true);
	GameEvents.Subscribe("find_generals_and_items_end_cooldown", EndCooldown);
})();